package com.ruoyi.file.service;

import com.ruoyi.file.domain.FileAttachmentInfo;
import com.ruoyi.file.domain.Kv;
import com.ruoyi.file.dto.FileAttachmentInfoDto;
import com.ruoyi.file.vo.FileAttachmentInfoVo;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 文件附件表服务类
 *
 * @author liuguoting
 * @since 2023-09-05 extends IService<FileAttachmentInfo>
 */
public interface IFileAttachmentInfoService {
    /**
     * 文件上传接口
     *
     * @param file
     * @return
     */
    FileAttachmentInfo   uploadFile(MultipartFile file, String tableName,  String colName, String associationId ,String watermark) throws Exception;


    public int deleteFileAttachmentInfoByIds(String[] ids);

    public List<FileAttachmentInfoVo> selectFileAttachmentInfoList(FileAttachmentInfoDto fileAttachmentInfo) throws IOException;

    HashMap<String ,Object> uploadAttachment( MultipartFile file,   String tableName,String colName, String associationId ,String watermark ) throws Exception;


    public FileAttachmentInfo selectFileAttachmentInfoById(String id);


    List<Kv> fileDetails(List<String> ids, String tableName, String colName) throws IOException;

    byte[]   getDownloadUrl(String key) throws IOException;

    String getObjectUrlByKey(String objectKey)throws IOException ;
}
